// Thor - High Performance C++ containers and algorithm library.
//
// Copyright (c) 2010 Su Shi. All rights reserved.
//
// Author: Su Shi <carmack.shi [at] gmail.com>

#ifndef THOR_PRIORITY_QUEUE_H_
#define THOR_PRIORITY_QUEUE_H_

#include <cstddef>
#include <functional>

#include <thor_binomial_heap.h>

namespace thor {

// Flexible Priority Queue with different mergeable heap.
template<typename T, typename Heap = BinomialHeap<T>,
                     typename Compare = std::less<T> >
class PriotiryQueue {
 public:
  PriotiryQueue()
    : heap_() { }
  template<typename InputIterator>
  explicit PriotiryQueue(InputIterator first, InputIterator last);

  bool Empty() const {
    return heap_.Empty();
  }

  size_t Size() const {
    return heap_.Size();
  }

  const T& Top() const {
    return *heap_.Minimum();
  }

  void Push(const T& value) {
    return heap_.Insert(value);
  }

  void Pop() {
    heap_.ExtractMinimum();
  }

 private:
  Heap heap_;
};

}  // namespace thor

#endif  // THOR_PRIORITY_QUEUE_H_
